package com.hlxt.nj.common;

import java.util.HashMap;
import java.util.Map;

/**
 * 返回码表
 * @author wangwei
 */
public class RetCodeDef {
	
	/*系统相关的 -0000-1000*/
	//成功
	public static String SUCCESS = "0000";
	//参数鉴权失败
	public static String PARA_AUTH_FAIL = "0010";
	//SQL异常
	public static String SQL_ERROR = "0020";	
	//查询结果为空
	public static String QUERY_EMPTY = "0030";
	//找不到对应的funcode
	public static String NO_SUCH_FUNCODE = "0040";
	//未知错误
	public static String UNKNOW_ERROR = "0050";
	//任务不是初始状态
	public static String START_ERROR = "0060";
	
	/*激活码相关 -1001-1100*/
	//激活成功
	public static String ACTIVATE_SUCCESS = "1001";
	//激活失败
	public static String ACTIVATE_FAILURE = "1002";
	//重复激活
	public static String DUPLICATE_ACTIVATE = "1003";
	//激活码已被使用
	public static String LICENCENO_ALREADY_IN_USE = "1004";
	//无效的激活码
	public static String NO_SUCH_LICENCENO = "1005";
	//激活码已过期
	public static String LICENCENO_OVERDUE = "1006";
	
	/*用户相关 -1101 - 1200*/
	//用户不存在
	public static String USER_DO_NOT_EXIST = "1101";
	//密码错误
	public static String USER_PASSWORD_INCORRECT = "1102";
	//用户已被注销
	public static String USER_CANCEL = "1103";
	//更新用户状态被相关任务关联导致失败
	public static String USER_WRITE_OFF_FAILURE = "1104";
	//注册用户，工号已存在
	public static String USER_LOGINNAME_EXIST = "1105";
	//用户修改密码，原密码错误
	public static String USER_OLD_PASSWORD_INCORRECT = "1106";
	//获取未被注销用户，列表为空
	public static String USER_DO_NOT_CANCEL_LIST_NULL = "1107";
	
	/*DDOS任务相关 -1201 - 1300*/
	//任务状态不是初始状态
	public static String DDOS_NO_INIT = "1201";
	//任务名称已存在
	public static String DDOS_NAME_EXIST = "1202";
	//任务下没有攻击端
	public static String DDOS_TOOL_NULL = "1204";
	//任务状态不是已下发状态
	public static String DDOS_NO_GIVE = "1205";
	//任务状态不是进行中状态
	public static String DDOS_NO_GOING = "1206";
	//任务状态不是初始、正在下发、已下发，中的一种
	public static String DDOS_NO_IGG = "1207";
	//任务下发时间已过期
	public static String DDOS_TIME_LIMIT = "1208";
	
	/*DDOSTOOL相关 -1301 - 1400*/
	//ip地址已存在
	public static String DDOSTOOL_IP_EXIST = "1301";
	//修改攻击端，被相关任务关联导致失败(初始、正在下发、已下发、进行中)
	public static String DDOSTOOL_UPDATE_FAILURE = "1302";
	//获取在线攻击端列表，且没有被初始、正在下发、已下发、进行中的任务使用，列表为空
	public static String DDOSTOOL_DO_NOT_CANCEL_LIST_NULL = "1303";
	//修改攻击端，正在部署导致失败
	public static String DDOSTOOL_UPDATE_FAILURE2 = "1304";
	//一键部署失败, 该攻击端正在部署中
	public static String DDOSTOOL_ARRANGE_FAIL = "1305";
	
	/*样本相关 -1401 - 1500*/
	//获取同类型下样本列表为空
	public static String SAMPLE_LIST_NULL = "1401";
	
	/*样本库相关 -1501 - 1600*/
	//样本库名称已存在，同类型下
	public static String SAMPLEBANK_NAME_EXIST = "1501";
	//成功创建样本库，但添加样本失败
	public static String SAMPLEBANK_ADD_SAMPLE_FAILURE = "1502";
	//操作样本库下样本失败，样本库被任务关联(初始、已下发、就绪、进行中)
	public static String SAMPLEBANK_OPERATE_SAMPLE_FAILURE = "1503";
	//获取样本库列表，且没有被当前任务使用，列表为空
	public static String SAMPLEBANK_LIST_NULL = "1504";
	
	/*拨测任务相关 -1601 - 1700*/
	//任务名称已存在
	public static String TASK_NAME_EXIST = "1601";
	//任务状态不是初始状态或下发失败状态
	public static String TASK_NO_INIT = "1602";
	//下发任务不满足，至少一个靶机，两种类型样本库
	public static String TASK_GIVE_FAILURE = "1604";
	//任务状态不是已下发状态
	public static String TASK_NO_GIVE = "1605";
	//任务状态不是进行中状态
	public static String TASK_NO_GOING = "1606";
	//任务状态不是初始、'正在下发'、'下发失败'、已下发、就绪中的一种
	public static String TASK_NO_IGG = "1607";
	//执行人员账号被注销
	public static String TASK_GIVEUSER_CANCEL = "1608";
	//任务状态不是就绪状态
	public static String TASK_NO_READY = "1609";
	//获取任务状态为进行中的任务,列表为空
	public static String TASK_GOING_LIST_NULL = "1610";
	//任务使用次数无限次
	public static String TASK_TOTALTIMES_NO_LIMIT = "1611";
	//任务上传次数使用完
	public static String TASK_TOTALTIMES_UP_LIMIT = "1613";
	//任务下载次数使用完
	public static String TASK_TOTALTIMES_DOWN_LIMIT = "1615";
	//暂无任务
	public static String TASK_NULL = "1616";
	
	/*靶机相关 -1701 - 1800*/
	//IP地址已存在
	public static String TARGET_IP_EXIST = "1701";
	//修改靶机，被相关任务关联导致失败(初始、已下发、就绪、进行中)
	public static String TARGET_UPDATE_FAILURE = "1702";
	//连接超时
	public static String TARGET_TIMEOUT = "1703";
	//获取在线靶机列表，且没有被当前任务使用，列表为空
	public static String TARGET_DO_NOT_CANCEL_LIST_NULL = "1704";
	//靶机列表，存在离线的靶机
	public static String TARGET_LIST_HAVE_CANCEL = "1705";
	//修改IP地址或端口失败，FTP服务被开启
	public static String TARGET_OPEN_FTP = "1706";
	//禁用靶机，FTP服务被开启
	public static String TARGET_OPEN_FTP2 = "1707";

	/*企业相关 -1801  - 1900*/
	//企业名称已存在
	public static String COMPANY_IP_EXIST = "1801";
	//企业列表暂无数据
	public static String COMPANY_LIST_NULL = "1802";
	//企业任务数量已使用到设定值
	public static String COMPANY_TASKNUMBER_FINISH = "1803";


	
	/*上传相关 -2001-3000*/
	//上传文件的总大小超出限制的最大值
	public static String SIZE_LIMIT_EXCEEDED = "2002";
	//文件格式错误
	public static String FILE_FAILURE = "2003";
	//文件名称已存在
	public static String FILE_NAME_EXIST = "2004";
	//上传文件，单文件大小超出限制的最大值
	public static String SIZE_LIMIT_ONE = "2005";
	//文件名称超出最大值长度
	public static String FILE_NAME_TOO_LONG = "2006";
	//文件名称包含中文
	public static String FILE_NAME_CH = "2007";
	//没有选择文件
	public static String NO_FILE = "2008";
	
	/*客户端更新相关 -3001-4000*/
	//获取版本信息成功
	public static String DOWNLOAD_CHECK_VERSION_SUCCESS = "3001";
	//获取版本信息失败
	public static String DOWNLOAD_CHECK_VERSION_FAILURE = "3002";

	
	public static Map<String,String> retCodeMap = new HashMap<String,String>();	
		static{
			/*系统相关*/
			retCodeMap.put(RetCodeDef.SUCCESS,"成功");
			retCodeMap.put(RetCodeDef.PARA_AUTH_FAIL,"参数鉴权失败!");
			retCodeMap.put(RetCodeDef.SQL_ERROR,"SQL异常!");
			retCodeMap.put(RetCodeDef.QUERY_EMPTY,"查询结果为空!");
			retCodeMap.put(RetCodeDef.NO_SUCH_FUNCODE,"找不到对应的FUNCODE!");
			retCodeMap.put(RetCodeDef.UNKNOW_ERROR,"未知错误!");
			
			/*激活码相关*/
			retCodeMap.put(RetCodeDef.ACTIVATE_SUCCESS,"激活成功");
			retCodeMap.put(RetCodeDef.ACTIVATE_FAILURE,"激活失败!");
			retCodeMap.put(RetCodeDef.DUPLICATE_ACTIVATE,"重复激活!");
			retCodeMap.put(RetCodeDef.LICENCENO_ALREADY_IN_USE,"激活码已被使用!");
			retCodeMap.put(RetCodeDef.NO_SUCH_LICENCENO,"无效的激活码!");
			retCodeMap.put(RetCodeDef.LICENCENO_OVERDUE,"激活码已过期!");
			
			/*用户相关*/
			retCodeMap.put(RetCodeDef.USER_DO_NOT_EXIST,"用户不存在!");
			retCodeMap.put(RetCodeDef.USER_PASSWORD_INCORRECT,"密码错误!");
			retCodeMap.put(RetCodeDef.USER_CANCEL,"用户已被注销!");
			retCodeMap.put(RetCodeDef.USER_WRITE_OFF_FAILURE,"该用户已被任务关联且任务状态属于'初始'、'正在下发'、'下发失败'、'已下发'、'就绪'或'进行中'一种!");
			retCodeMap.put(RetCodeDef.USER_LOGINNAME_EXIST,"工号已存在!");
			retCodeMap.put(RetCodeDef.USER_OLD_PASSWORD_INCORRECT,"原密码错误!");
			retCodeMap.put(RetCodeDef.USER_DO_NOT_CANCEL_LIST_NULL,"无未注销人员可选择!");
			
			/*DDOS任务*/
			retCodeMap.put(RetCodeDef.DDOS_NO_INIT,"任务状态不是初始状态或下发失败状态!");
			retCodeMap.put(RetCodeDef.DDOS_NO_GIVE,"任务状态不是已下发状态!");
			retCodeMap.put(RetCodeDef.DDOS_NO_GOING,"任务状态不是进行中状态!");
			retCodeMap.put(RetCodeDef.DDOS_NO_IGG,"任务状态不属于'初始'、'正在下发'、'下发失败'或'已下发'!");
			retCodeMap.put(RetCodeDef.DDOS_NAME_EXIST,"任务名称已存在!");
			retCodeMap.put(RetCodeDef.DDOS_TOOL_NULL,"任务下至少存在1个攻击端!");
			retCodeMap.put(RetCodeDef.DDOS_TIME_LIMIT,"开始时间必须大于当前系统时间,才能被下发,此任务已失效!");
			
			/*DDOSTOOL相关*/
			retCodeMap.put(RetCodeDef.DDOSTOOL_IP_EXIST,"IP地址已存在!");
			retCodeMap.put(RetCodeDef.DDOSTOOL_UPDATE_FAILURE,"该攻击端已被任务关联且任务状态属于'初始'、'正在下发'、'下发失败'、'已下发'或'进行中'一种!");
			retCodeMap.put(RetCodeDef.DDOSTOOL_DO_NOT_CANCEL_LIST_NULL,"无符合条件的攻击端可选择!");
			retCodeMap.put(RetCodeDef.DDOSTOOL_UPDATE_FAILURE2,"该攻击端正在部署中!");
			retCodeMap.put(RetCodeDef.DDOSTOOL_ARRANGE_FAIL,"该攻击端正在部署中!");
			
			/*样本相关*/
			retCodeMap.put(RetCodeDef.SAMPLE_LIST_NULL,"无样本可选择!");
			
			/*样本库相关*/
			retCodeMap.put(RetCodeDef.SAMPLEBANK_NAME_EXIST,"样本库名称已存在!");
			retCodeMap.put(RetCodeDef.SAMPLEBANK_ADD_SAMPLE_FAILURE,"未成功添加样本,SQL异常!");
			retCodeMap.put(RetCodeDef.SAMPLEBANK_OPERATE_SAMPLE_FAILURE,"该样本库已被任务关联且任务状态属于'初始'、'正在下发'、'下发失败'、'已下发'、'就绪'或'进行中'一种!");
			retCodeMap.put(RetCodeDef.SAMPLE_LIST_NULL,"无样本库可选择!");
			
			/*拨测任务相关*/
			retCodeMap.put(RetCodeDef.TASK_NAME_EXIST,"任务名称已存在!");
			retCodeMap.put(RetCodeDef.TASK_NO_INIT,"任务状态不是初始状态或下发失败状态!");
			retCodeMap.put(RetCodeDef.TASK_NO_GIVE,"任务状态不是已下发状态!");
			retCodeMap.put(RetCodeDef.TASK_NO_READY,"任务状态不是就绪状态!");
			retCodeMap.put(RetCodeDef.TASK_NO_GOING,"任务状态不是进行中状态!");
			retCodeMap.put(RetCodeDef.TASK_NO_IGG,"任务状态不属于'初始'、'正在下发'、'下发失败'、'已下发'或'就绪'!");
			retCodeMap.put(RetCodeDef.TASK_GIVE_FAILURE,"任务下至少要有1个靶机、1个样本库!");
			retCodeMap.put(RetCodeDef.TASK_GIVEUSER_CANCEL,"执行人员账号已被注销!");
			retCodeMap.put(RetCodeDef.TASK_GOING_LIST_NULL,"无进行中任务可选择!");
			retCodeMap.put(RetCodeDef.TASK_TOTALTIMES_NO_LIMIT,"该任务可以无限次使用!");
			retCodeMap.put(RetCodeDef.TASK_TOTALTIMES_UP_LIMIT,"该任务相关功能上传次数使用完!");
			retCodeMap.put(RetCodeDef.TASK_TOTALTIMES_DOWN_LIMIT,"该任务相关功能下载次数使用完!");
			retCodeMap.put(RetCodeDef.TASK_NULL,"暂无任务");
			
			/*靶机相关*/
			retCodeMap.put(RetCodeDef.TARGET_IP_EXIST,"IP地址、端口已存在!");
			retCodeMap.put(RetCodeDef.TARGET_UPDATE_FAILURE,"该靶机已被任务关联且任务状态属于'初始'、'正在下发'、'下发失败'、'已下发'、'就绪'或'进行中'一种!");
			retCodeMap.put(RetCodeDef.TARGET_TIMEOUT,"连接超时!");
			retCodeMap.put(RetCodeDef.TARGET_DO_NOT_CANCEL_LIST_NULL,"无开启FTP服务并且启用的靶机可选择!");
			retCodeMap.put(RetCodeDef.TARGET_LIST_HAVE_CANCEL,"靶机列表存在离线靶机或未开启FTP服务的靶机!");
			retCodeMap.put(RetCodeDef.TARGET_OPEN_FTP,"要修改IP地址或端口信息，请先关闭FTP服务!");
			retCodeMap.put(RetCodeDef.TARGET_OPEN_FTP2,"请先关闭FTP服务，在禁用靶机!");
			
			/*上传相关*/
			retCodeMap.put(RetCodeDef.SIZE_LIMIT_EXCEEDED,"上传文件的总大小超出限制的最大值!");
			retCodeMap.put(RetCodeDef.FILE_FAILURE,"文件格式错误!");
			retCodeMap.put(RetCodeDef.FILE_NAME_EXIST,"文件名称已存在!");
			retCodeMap.put(RetCodeDef.SIZE_LIMIT_ONE,"某个文件的大小超出限制的最大值!");
			retCodeMap.put(RetCodeDef.FILE_NAME_TOO_LONG,"文件名称不能超过50个字符!");
			retCodeMap.put(RetCodeDef.FILE_NAME_CH,"文件名称不能包含中文!");
			retCodeMap.put(RetCodeDef.NO_FILE,"没有选择文件!");
			
			/*客户端更新相关*/
			retCodeMap.put(RetCodeDef.DOWNLOAD_CHECK_VERSION_SUCCESS,"获取版本信息成功");
			retCodeMap.put(RetCodeDef.DOWNLOAD_CHECK_VERSION_FAILURE,"获取版本信息失败!");
			
		}
}
